#include<map>
#include<iostream>
#include<string>

struct category {
        category() : id(0), name() {}
        category(int newId, std::string newName): id(newId), name(newName) {}
        category(const category &p){id=p.id;name=p.name;}

        int id;
        std::string name;
};

std::map<int,category>::iterator it;
std::map<int,category> categories;
std::pair<std::map<int,category>::iterator,bool>ret;

int main() {
    std::string hola;
    category prueba;
    prueba.id=3;
    prueba.name="Third category";
        categories[1] = category(1, "First category");
        categories[2] = category(2, "Second category");
        it=categories.find(2);
        (*it).second.name="y como quiera funciona";
        hola+=65;

          for ( it=categories.begin() ; it != categories.end(); it++ )
          std::cout << (*it).first << " => " << (*it).second.id <<(*it).second.name << std::endl;
 
        std::cout<<hola<<std::endl;
  return 0;
}